package org.example.slave;

import lombok.RequiredArgsConstructor;
import org.example.slave.bootstrap.Bootstrap;
import org.example.slave.enums.PersistenceType;
import org.example.slave.enums.SourceType;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author dingrui
 * @since 2022/2/14
 * @description
 */
@SpringBootApplication
@RequiredArgsConstructor
public class SlaveApp implements ApplicationRunner {

    private final Bootstrap bootstrap;

    public static void main(String[] args) {
        SpringApplication.run(SlaveApp.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.bootstrap.start(SourceType.MYSQL, PersistenceType.CONSOLE);
    }
}
